﻿using Projectframes.DeviceClasses;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using YJYpublicClass;
using YJYpublicClass.DataStruct;

namespace Projectframes.DeviceSetFroms
{
    public partial class Frm_system : Form
    {
        public Frm_system(AppDevice obj)
        {
            InitializeComponent();
            device= obj;
        }

        AppDevice device;
        private void Frm_system_Load(object sender, EventArgs e)
        {
            this.propertyGrid1.SelectedObject= device.Config;
        }

        private void btn_保存设置_Click(object sender, EventArgs e)
        {
            
            if (device.Saveconfig().State==Funstate.OK)
            {
                MessageBox.Show("数据保存成功，重新启动后生效！");
            }
            else
            {
                //保存失败
                MessageBox.Show("数据保存失败");
            }
        }


    }
}
